<?php
class VerifyController extends AppController {
    
    public $uses = array('siteVerify');
    public function index() {
        $this->layout = '';
        if(isset($_GET['token']) && $_GET['token'] != '')
        $data = $this->siteVerify->find('first',array('conditions'=>array('token'=>$_GET['token'])));
        if(isset($data['siteVerify']) && $data['siteVerify']['token'] == $_GET['token'] && $data['siteVerify']['status'] == 1){
            $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'none';
            $this->set('data',$data);
        }else{
            //echo sprintf("console.log('%s')",'Welcome user');
            exit;
        }
	}
    
    public function account() {
        $paginate = array();
        $condition = array();
        
        $paginate['limit'] = 10;
        $paginate['order'] = array('id' => 'desc');
        $this->paginate = $paginate;
        $data = $this->paginate('siteVerify');
        $this->set('data',$data);
	}
    
    public function accountopr() {
        if ($this->request->is('post')) {
            if($this->siteVerify->save($this->data)){
                $this->Session->setFlash(__('Record Save.'));
            }
        }
        $this->redirect(array('controller' => 'verify', 'action' => 'account'));
	}
    
}